using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
namespace MRSite.Entity
{
    [Table(Name = "customer")]
    public class Customer : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

        /// <summary>
        ///用户名
        /// </summary>
        [Column(Name = "username")]
        public String username { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Column(Name = "nickname")]
        public String nickname { get; set; }

        /// <summary>
        /// 邀请码
        /// </summary>
        [Column(Name = "inviter")]
        public String inviter { get; set; }


        /// <summary>
        ///用户姓名
        /// </summary>
        [Column(Name = "realname")]
        public String realname { get; set; }


        /// <summary>
        /// 拼团级别（1 个人普通会员；2企业ID；）
        /// </summary>
        [Column(Name = "group_id")]
        public int group_id { get; set; }

        /// <summary>
        /// 会员级别 （1普通新用户；2	普通老用户；3：批发商）
        /// </summary>
        [Column(Name = "levels")]
        public int levels { get; set; }




        /// <summary>
        ///推荐人编号
        /// </summary>
        [Column(Name = "pid")]
        public int pid { get; set; }

        /// <summary>
        ///路径
        /// </summary>
        [Column(Name = "ppath")]
        public String ppath { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        [Column(Name = "plevel")]
        public int plevel { get; set; }

        /// <summary>
        /// 批发商id
        /// </summary>
        [Column(Name = "pfs_id")]
        public int pfs_id { get; set; }

        /// <summary>
        /// 批发商是否能享受间推奖
        /// </summary>
        [Column(Name = "iscanjt")]
        public int iscanjt { get; set; }



        /// <summary>
        /// 有效批发商开始时间
        /// </summary>
        [Column(Name = "canjttime")]
        public DateTime? canjttime { get; set; }



        /// <summary>
        ///一级密码
        /// </summary>
        [Column(Name = "pass")]
        public String pass { get; set; }




        /// <summary>
        ///支付密码
        /// </summary>
        [Column(Name = "passpay")]
        public String passpay { get; set; }

        /// <summary>
        ///  密码格式
        /// </summary>
        [Column(Name = "salt")]
        public String salt { get; set; }


        /// <summary>
        /// 用户状态0正常,1未审核,2锁定；3预销户
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }

        /// <summary>
        ///手机
        /// </summary>
        [Column(Name = "mobile")]
        public String mobile { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Column(Name = "email")]
        public String email { get; set; }

        /// <summary>
        ///身份证
        /// </summary>
        [Column(Name = "card")]
        public String card { get; set; }

        /// <summary>
        ///性别
        /// </summary>
        [Column(Name = "sex")]
        public String sex { get; set; }


        /// <summary>
        ///服务中心编号
        /// </summary>
        [Column(Name = "serviceid")]
        public String serviceid { get; set; }



        /// <summary>
        ///
        /// </summary>
        [Column(Name = "regtime", IsDbGenerated = true)]
        public DateTime regtime { get; set; }

        /// <summary>
        ///  激活时间
        /// </summary>
        [Column(Name = "checktime")]
        public DateTime? checktime { get; set; }

        /// <summary>
        /// 按确认的先后顺序排序
        /// </summary>
        [Column(Name = "sort")]
        public int sort { get; set; }


        /// <summary>
        /// 我的二维码
        /// </summary>
        [Column(Name = "myqrcode")]
        public String myqrcode { get; set; }

        /// <summary>
        /// 我的分享二维码
        /// </summary>
        [Column(Name = "myposter")]
        public String myposter { get; set; }






        /// <summary>
        ///注册资金(团队长达到封顶红包后清0，需要重新购物升级)
        /// </summary>
        [Column(Name = "regamount")]
        public Decimal regamount { get; set; }

        /// <summary>
        // /累计购物金额 资金
        /// </summary>
        [Column(Name = "levelsamount")]
        public Decimal levelsamount { get; set; }

        /// <summary>
        /// PV值 能返的最大资金
        /// </summary>
        [Column(Name = "canreturnamout")]
        public Decimal canreturnamout { get; set; }

        /// <summary>
        /// 总收入现金币
        /// </summary>
        [Column(Name = "totalfee")]
        public Decimal totalfee { get; set; }

        /// <summary>
        /// 现金币余额(可提现)
        /// </summary>
        [Column(Name = "balance")]
        public Decimal balance { get; set; }

        /// <summary>
        /// 已消费现金币
        /// </summary>
        [Column(Name = "salesfee")]
        public Decimal salesfee { get; set; }

        /// <summary>
        /// 贡献值
        /// </summary>
        [Column(Name = "score")]
        public Decimal score { get; set; }

        /// <summary>
        /// 累计贡献值
        /// </summary>
        [Column(Name = "totalscore")]
        public Decimal totalscore { get; set; }

        /// <summary>
        /// 今日累计贡献值，每天转换成共建值后，自动清0
        /// </summary>
        [Column(Name = "score_today")]
        public Decimal score_today { get; set; }

        /// <summary>
        /// 今日自己的贡献值（不包括推荐奖励），每天转释放可用共建值后，自动清0
        /// </summary>
        [Column(Name = "score_today_self")]
        public Decimal score_today_self { get; set; }

        /// <summary>
        /// 服务网点的贡献值(每达到10万释放一次网点奖励，释放后清0)
        /// </summary>
        [Column(Name = "score_fwwd")]
        public Decimal score_fwwd { get; set; }


        /// <summary>
        /// 可用共建值 金币
        /// </summary>
        [Column(Name = "golds")]
        public decimal golds { get; set; }

        /// <summary>
        /// 累计可用共建值
        /// </summary>
        [Column(Name = "totalgolds")]
        public decimal totalgolds { get; set; }


        /// <summary>
        /// 锁仓共建值 
        /// </summary>
        [Column(Name = "golds_jt")]
        public decimal golds_jt { get; set; }

        /// <summary>
        /// 累计锁仓共建值
        /// </summary>
        [Column(Name = "totalgolds_jt")]
        public decimal totalgolds_jt { get; set; }

        /// <summary>
        ///  积分
        /// </summary>
        [Column(Name = "points")]
        public decimal points { get; set; }

        /// <summary>
        /// 累计积分
        /// </summary>
        [Column(Name = "totalpoints")]
        public decimal totalpoints { get; set; }

        /// <summary>
        /// 红包余额
        /// </summary>
        [Column(Name = "hongbao")]
        public Decimal hongbao { get; set; }


        /// <summary>
        /// 累计红包
        /// </summary>
        [Column(Name = "totalhongbao")]
        public Decimal totalhongbao { get; set; }

        /// <summary>
        /// 锁仓红包
        /// </summary>
        [Column(Name = "hongbao_sc")]
        public Decimal hongbao_sc { get; set; }


        /// <summary>
        /// 个人消费红包(累计)
        /// </summary>
        [Column(Name = "hongbaosale")]
        public Decimal hongbaosale { get; set; }

        /// <summary>
        /// 首购奖励共建值
        /// </summary>
        [Column(Name = "shougoujl")]
        public Decimal shougoujl { get; set; }

        /// <summary>
        /// 累计首购奖励共建值
        /// </summary>
        [Column(Name = "totalshougoujl")]
        public Decimal totalshougoujl { get; set; }


        /// <summary>
        /// 拼省包 (暂未用到)
        /// </summary>
        [Column(Name = "grouphb")]
        public decimal grouphb { get; set; }

        /// <summary>
        /// 累计拼省包
        /// </summary>
        [Column(Name = "totalgrouphb")]
        public decimal totalgrouphb { get; set; }

        /// <summary>
        /// 网点奖励共建值
        /// </summary>
        [Column(Name = "serviceJl")]
        public decimal serviceJl { get; set; }

        /// <summary>
        /// 累计网点奖励共建值
        /// </summary>
        [Column(Name = "totalserviceJl")]
        public decimal totalserviceJl { get; set; }

        /// <summary>
        /// 养老共建值
        /// </summary>
        [Column(Name = "pension")]
        public decimal pension { get; set; }

        /// <summary>
        /// 累计养老共建值
        /// </summary>
        [Column(Name = "totalpension")]
        public decimal totalpension { get; set; }

        /// <summary>
        ///  爱心
        /// </summary>
        [Column(Name = "aixin")]
        public Decimal aixin { get; set; }

        /// <summary>
        ///  已提现共建值
        /// </summary>
        [Column(Name = "txamount")]
        public Decimal txamount { get; set; }

        /// <summary>
        ///  已卖出共建值
        /// </summary>
        [Column(Name = "sellamount")]
        public Decimal sellamount { get; set; }
        /// <summary>
        ///  投资共建值
        /// </summary>
        [Column(Name = "cjamount")]
        public Decimal cjamount { get; set; }

        /// <summary>
        /// 直推奖
        /// </summary>
        [Column(Name = "zhitui")]
        public Decimal zhitui { get; set; }

        /// <summary>
        /// 单推奖 见点奖
        /// </summary>
        [Column(Name = "jiandian")]
        public Decimal jiandian { get; set; }


        /// <summary>
        /// 累计释放可用共建值
        /// </summary>
        [Column(Name = "returngolds")]
        public Decimal returngolds { get; set; }

        /// <summary>
        /// 累计转换贡献值
        /// </summary>
        [Column(Name = "returnpoints")]
        public Decimal returnpoints { get; set; }



        /// <summary>
        /// 当日返点金币（只限每日返的5%）
        /// </summary>
        [Column(Name = "daygolds")]
        public Decimal daygolds { get; set; }

        /// <summary>
        /// 团队奖励
        /// </summary>
        [Column(Name = "teamjl")]
        public decimal teamjl { get; set; }

        /// <summary>
        /// 团队平级奖励
        /// </summary>
        [Column(Name = "teamjl_pj")]
        public decimal teamjl_pj { get; set; }

        /// <summary>
        /// 分红
        /// </summary>
        [Column(Name = "fenghong")]
        public decimal fenghong { get; set; }




        /// <summary>
        ///冻结金额(提现)
        /// </summary>
        [Column(Name = "freezeamount")]
        public Decimal freezeamount { get; set; }

        /// <summary>
        /// 累计提现金额
        /// </summary>
        [Column(Name = "txtotalamount")]
        public Decimal txtotalamount { get; set; }





        /// <summary>
        /// 报单奖
        /// </summary>
        [Column(Name = "baodan")]
        public Decimal baodan { get; set; }

        /// <summary>
        /// 团队业绩
        /// </summary>
        [Column(Name = "totalteamyeji")]
        public Decimal totalteamyeji { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [Column(Name = "avatar")]
        public String avatar { get; set; }

        /// <summary>
        ///地址
        /// </summary>
        [Column(Name = "addr")]
        public String addr { get; set; }

        /// <summary>
        ///邮编
        /// </summary>
        [Column(Name = "postcode")]
        public String postcode { get; set; }


        /// <summary>
        /// openid
        /// </summary>
        [Column(Name = "openid")]
        public String openid { get; set; }

        /// <summary>
        /// 收货人姓名
        /// </summary>
        [Column(Name = "acceptName")]
        public String acceptName { get; set; }

        /// <summary>
        /// 收货人手机
        /// </summary>
        [Column(Name = "acceptMobile")]
        public String acceptMobile { get; set; }

        /// <summary>
        /// 注册时 省
        /// </summary>
        [Column(Name = "province")]
        public String province { get; set; }

        /// <summary>
        /// 注册时 市
        /// </summary>
        [Column(Name = "city")]
        public String city { get; set; }

        /// <summary>
        /// 注册时 县
        /// </summary>
        [Column(Name = "area")]
        public String area { get; set; }



        /// <summary>
        ///开户银行
        /// </summary>
        [Column(Name = "bankname")]
        public String bankname { get; set; }

        /// <summary>
        ///开户名
        /// </summary>
        [Column(Name = "accountname")]
        public String accountname { get; set; }


        /// <summary>
        ///银行卡号
        /// </summary>
        [Column(Name = "bankaccount")]
        public String bankaccount { get; set; }

        /// <summary>
        ///银行支行名称
        /// </summary>
        [Column(Name = "branchname")]
        public String branchname { get; set; }



        /// <summary>
        /// 提现 微信号
        /// </summary>
        [Column(Name = "weixin")]
        public String weixin { get; set; }

        /// <summary>
        /// 提现 微信真实姓名
        /// </summary>
        [Column(Name = "weixin_name")]
        public String weixin_name { get; set; }

        /// <summary>
        /// 提现 支付宝帐号
        /// </summary>
        [Column(Name = "alipay")]
        public String alipay { get; set; }

        /// <summary>
        /// 提现 支付宝帐号真实姓名
        /// </summary>
        [Column(Name = "alipay_name")]
        public String alipay_name { get; set; }

        /// <summary>
        /// 是否出局
        /// </summary>
        [Column(Name = "isout")]
        public int isout { get; set; }

        /// <summary>
        /// 是否服务网点
        /// </summary>
        [Column(Name = "isservice")]
        public int isservice { get; set; }

        /// <summary>
        /// 微信收款码
        /// </summary>
        [Column(Name = "weixinpay")]
        public String weixinpay { get; set; }




        /// <summary>
        /// 是否空单
        /// </summary>
        [Column(Name = "isfree")]
        public int isfree { get; set; }

        /// <summary>
        /// 推荐人手机号
        /// </summary>
        [Column(Name = "tjmobile")]
        public String tjmobile { get; set; }

        /// <summary>
        /// 诚信指数
        /// </summary>
        [Column(Name = "chenxinzhishu")]
        public decimal chenxinzhishu { get; set; }

        /// <summary>
        /// 是否实名认证 0未认证，1已认证， 2正在审核，3认证失败
        /// </summary>
        [Column(Name = "isrenzheng")]
        public int isrenzheng { get; set; }

        /// <summary>
        ///  是否驳回
        /// </summary>
        [Column(Name = "isback")]
        public int? isback { get; set; }

        /// <summary>
        ///  认证时间
        /// </summary>
        [Column(Name = "renzh_time")]
        public DateTime? renzh_time { get; set; }

        /// <summary>
        ///  身份证正面
        /// </summary>
        [Column(Name = "cardUp")]
        public string cardUp { get; set; }

        /// <summary>
        ///  身份证反面
        /// </summary>
        [Column(Name = "cardDown")]
        public string cardDown { get; set; }

        /// <summary>
        ///  手持身份证
        /// </summary>
        [Column(Name = "cardHand")]
        public string cardHand { get; set; }



        /// <summary>
        /// 是否店铺
        /// </summary>
        [Column(Name = "isshop")]
        public int isshop { get; set; }

        /// <summary>
        /// 店铺类别
        /// </summary>
        [Column(Name = "shoptype")]
        public int shoptype { get; set; }


        /// <summary>
        /// 推荐人数
        /// </summary>
        [Column(Name = "tjcount")]
        public int tjcount { get; set; }

        /// <summary>
        /// 推荐实名认证人数
        /// </summary>
        [Column(Name = "tjcount_rz")]
        public int tjcount_rz { get; set; }

        /// <summary>
        /// 有效推荐人数
        /// </summary>
        [Column(Name = "yxtjcount")]
        public int yxtjcount { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [Column(Name = "lastlogintime")]
        public DateTime? lastlogintime { get; set; }

        /// <summary>
        /// 预销户时间
        /// </summary>
        [Column(Name = "yshtime")]
        public DateTime? yshtime { get; set; }

        /// <summary>
        /// 成为批发商时间
        /// </summary>
        [Column(Name = "pfstime")]
        public DateTime? pfstime { get; set; }


        /// <summary>
        /// 是否代理
        /// </summary>
        [Column(Name = "isagent")]
        public int isagent { get; set; }

        /// <summary>
        /// 代理等级
        /// </summary>
        [Column(Name = "agent_level")]
        public int agent_level { get; set; }

        /// <summary>
        /// 成为代理时间
        /// </summary>
        [Column(Name = "agent_time")]
        public DateTime? agent_time { get; set; }

        /// <summary>
        /// 是否累计红包达到20元 享受日奖励
        /// </summary>
        [Column(Name = "ishbjl")]
        public int ishbjl { get; set; }

        /// <summary>
        /// 首次红包达到时间
        /// </summary>
        [Column(Name = "hbjl_time")]
        public DateTime? hbjl_time { get; set; }

        /// <summary>
        /// 直推批发商人数
        /// </summary>
        [Column(Name = "tjpfs_count")]
        public int tjpfs_count { get; set; }

        /// <summary>
        /// 团队批发商人数
        /// </summary>
        [Column(Name = "teampfs_count")]
        public int teampfs_count { get; set; }

        /// <summary>
        /// 临时使用- 昨日贡献值
        /// </summary>
        [Column(Name = "temp_score_today")]
        public decimal temp_score_today { get; set; }

        /// <summary>
        /// 临时使用- 昨日自己贡献值
        /// </summary>
        [Column(Name = "temp_score_today_self")]
        public decimal temp_score_today_self { get; set; }


        /// <summary>
        /// 卖出无限制  0:有限制；1：无限制 
        /// </summary>
        [Column(Name = "isnoxj")]
        public int isnoxj { get; set; }

        /// <summary>
        /// 是否屏蔽交易 0：未屏蔽；1已屏蔽
        /// </summary>
        [Column(Name = "ispingbi")]
        public int ispingbi { get; set; }


        private EntitySet<Customerloginlog> _customerloginlogList;
        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_customerloginlogList", ThisKey = "id", OtherKey = "user_id")]
        public EntitySet<Customerloginlog> customerloginlogList
        {
            get { return this._customerloginlogList; }
            set { this._customerloginlogList.Assign(value); }
        }

        private EntityRef<CustomerGroups> _customerGroups;
        /// <summary>
        /// 会员组别 外键
        /// </summary>
        [Association(Storage = "_customerGroups", ThisKey = "group_id", OtherKey = "id")]
        public CustomerGroups CustomerGroupItem
        {
            get { return this._customerGroups.Entity; }
            set { this._customerGroups.Entity = value; }
        }

        private EntityRef<CustomerLevels> _customerLevels;
        /// <summary>
        /// 排单会员级别 外键
        /// </summary>
        [Association(Storage = "_customerLevels", ThisKey = "levels", OtherKey = "id")]
        public CustomerLevels CustomerLevelItem
        {
            get { return this._customerLevels.Entity; }
            set { this._customerLevels.Entity = value; }
        }


        public Customer()
        {
            this._customerloginlogList = new EntitySet<Customerloginlog>();
        }
    }
}

